<?php
$subject = $this->subject;
$concessions = $this->concessions;
$concessionsPois = $this->concessionsPois;

?>
<div class="item_a">
<dl>
    <dt><em></em>优惠推荐</dt>
    <?php
    $maxIndex = min(count($concessions), 15);
    for ($i = 0; $i < $maxIndex; $i++):
        $con = $concessions[$i];
        $curConPoi = null;
        $firstPoiId = $con->getPoiIds();
        if (!empty($firstPoiId)):
            $firstPoiId = $firstPoiId[0];
            if (!empty($concessionsPois)):
                foreach ($concessionsPois as $conPoi):
                    if ($conPoi->equalId($firstPoiId)):
                        $curConPoi = $conPoi;
                        break;
                    endif;
                endforeach;
            endif;
        endif;
    ?>
        <dd> <a href="<?php echo $this->getUrl(array('id' => $con->getId()), 'detail', 'content', 'concessions') ?>"><span><?php echo $con->getName() ?></span> </a>
            <div>
                <ol>
                    <img src="<?php echo $con->getFirstPicture() ?>" width="240" height="180" />
                </ol>
                <ul>
                <?php if ($curConPoi): ?>
                    <li><strong><?php echo $curConPoi->getShopName() ?></strong></li>
                <?php endif; ?>
                <?php if ($curConPoi): ?>
                        <li>
                            <label>营业时间：</label>
                    <?php echo $curConPoi->getBusinessHours() ?></li>
                <?php endif; ?>
                <?php if ($curConPoi): ?>
                            <li>
                                <label>咨询电话：</label>
                    <?php echo $curConPoi->getBusinessPhone() ?></li>
                <?php endif; ?>
                <?php if ($curConPoi): ?>
                                <li>
                                    <label>移动电话：</label>
                    <?php echo $curConPoi->getMobile() ?></li>
                <?php endif; ?>
                                <li>
                                    <label>有效期限：</label>
                    <?php echo $this->formatDate($con->getStartTime()) ?> 至 <?php echo $this->formatDate($con->getEndTime()) ?></li>
                <?php if ($curConPoi): ?>
                                    <li>       
                                        <label>使用地点：</label>
                    <?php echo $curConPoi->getAddress() ?></li>
                <?php endif; ?>
                                </ul>
                            </div>
                        </dd>
    <?php endfor; ?>
</dl>
</div>

<div class="item_b">
<dl>
			<dt><em></em>主题标题</dt>
			<dd>
				<?php
                            if(!empty($concessionsPois)):
                                $mapPoiIds = $concessionsPois->getItemPropertyValue('id');
                                $roadId = $this->roads[0]->getId();
                        ?>
                            <script language="javascript" type="text/javascript">
                                mapUrl = '<?php echo $this->getUrl(array('width'=>652, 'id'=>$roadId, 'poi'=>implode(',', $mapPoiIds)), 'road', 'show', 'map')?>';
                            </script>
				<iframe id="map_frame" frameborder="0" scrolling="no" width="100%" height="465" src=""></iframe>
				<?php
                            endif;
                        ?>
			</dd>
		</dl>
	</div>
